<template>
	<view class="good" @tap="goDeatil">
		<image :src="good.thumb" class="good_thumb" mode=""></image>
		<view class="good_content">
			<view class="good_content_title">
				{{good.title}}
			</view>
			<view class="good_content_desc">
				{{good.desc}}
			</view>
			<view class="good_content_price">
				<text style="font-size: 24upx;">￥</text>
				<text>{{good.price}}</text>
			</view>
			<view class="good_content_oldprice">
				<text>￥{{good.oldprice}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"Good",
		data() {
			return {
				goodsid:''
			};
		},
		props: {
			good: {
				type: Object,
				default: function(){
					return {}
				}
			}
		},
		onLoad(options){
			
		},
		methods: {
			goDeatil(){
				var that = this;
				this.$common.navigateTo({id: that.good.id},"/pages/scoreGoods/detail")
			}
		}
	}
</script>

<style lang="scss">
	.good{
		width: 337upx;
		background-color: #fff;
		border-radius: 20upx;
		&_thumb{
			width: 100%;
			height: 337upx;
			border-radius: 20upx 20upx 2upx 2upx;
		}
		&_content{
			width: 100%;
			box-sizing: border-box;
			padding: 14upx;
			&_title{
				font-size: 28upx;
				line-height: 40upx;
				font-weight: bold;
				width: 100%;
				color: #333;
				min-width: 0;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}
			&_desc{
				font-size: 24upx;
				font-weight: 400;
				color: #999999;
				width: 100%;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				margin: 10upx 0;
			}
			&_price{
				color: #ff3000;
				font-weight: 600;
				font-size: 30upx;
			}
			&_oldprice{
				color: #c4c4c4;
				font-weight: 400;
				font-size: 26upx;
				text-decoration: line-through;
				margin-top: 10upx;
			}
		}
	}
</style>